package com.nCoV.EpidemicSurveillance.repository;

import java.util.List;
import java.util.Map;

import org.springframework.data.neo4j.annotation.Query;
import org.springframework.data.neo4j.repository.Neo4jRepository;
import org.springframework.stereotype.Component;

import com.nCoV.EpidemicSurveillance.domain.StudentPlaceRelationship;

/**
 * @author 罗穆健
 * @date 2020年4月27日
 */
@Component
public interface TongJiRepository extends Neo4jRepository<StudentPlaceRelationship, Long> {
	@Query("merge (n:TongJi{time::#{#time}}) set n.name = :#{#name} "
			+ "set n.qz = :#{#qz} "
			+ "set n.gfx = :#{#gfx} "
			+ "set n.zy = :#{#zy} "
			+ "set n.time = :#{#time} ")
	void updateTj(String name, int qz, int gfx, Integer zy, String time);

	@Query("match (n:TongJi) return n.name as name,n.qz as qz,n.gfx as gfx,n.zy as zy,n.time as time")
	List<Map<String, Object>> getAllTongJi();
}
